package licode.unisop.types.event;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 领域事件基类定义
 *
 * @author licode
 */
public class DomainEvent implements Serializable {

    private static final long serialVersionUID = 5683528902451980256L;

    private final String data;
    private final String demandId;
    private final String eventType;
    private final LocalDateTime occurredOn;

    public DomainEvent(String demandId, String data, String eventType) {
        this.demandId = demandId;
        this.occurredOn = LocalDateTime.now();
        this.data = data;
        this.eventType = eventType;
    }

    public String getDemandId() {
        return demandId;
    }

    public String getEventType() {
        return this.eventType;
    }

    public String getData() {
        return this.data;
    }

    public LocalDateTime getOccurredOn() {
        return occurredOn;
    }
}
